package top.heue.test.preference

import android.os.Bundle
import androidx.preference.Preference
import top.heue.test.R
import top.heue.utils.FC
import top.heue.utils.base.base.BasePreference
import top.heue.utils.v

class AppPreference : BasePreference() {
    override val name: String = "选项"
    override val resource: Int = R.xml.preference_app

    private val debug by v

    override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
        super.onCreatePreferences(savedInstanceState, rootKey)
        //findPreference<Preference>(debug)?.isVisible = BuildConfig.DEBUG
    }

    override fun onClick(key: String, preference: Preference) {
        super.onClick(key, preference)
        when (key) {
            debug -> {
                FC.startFragment(requireContext(), DebugPreference::class.java) {}
            }
        }
    }
}